package services.impl;

import beans.User;
import dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.UserServices;

import java.util.List;

@Service
public class UserServicesImpl implements UserServices {

    @Autowired
    private UserDao userDao;

    @Override
    public User login(String userId, String userPassword) {
        User user  = userDao.login(userId, userPassword);
        return user;
    }

    @Override
    public List<User> selectList() {
        List<User> list=userDao.selectList();
        return list;
    }

    @Override
    public List<User> selectSelective(String selectText, String inputText) {
        List<User> list = userDao.selectSelective(selectText,inputText);
        return list;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        int i = userDao.deleteByPrimaryKey(id);
        return i;
    }

    @Override
    public int insert(User record) {
        int i =userDao.insert(record);
        return i;
    }

    @Override
    public int insertSelective(User record) {
        int i = userDao.insertSelective(record);
        return i;
    }

    @Override
    public User selectByPrimaryKey(Integer id) {
        User user = userDao.selectByPrimaryKey(id);
        return user;
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        int i = userDao.updateByPrimaryKeySelective(record);
        return i;
    }

    @Override
    public int updateByPrimaryKey(User record) {
        int i = userDao.updateByPrimaryKey(record);
        return i;
    }

    @Override
    public int count() {
        return userDao.count();
    }
}
